package com.htl.exampro.course.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.htl.exampro.course.pojo.domain.CourseSelectionDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 * 用户选课关联表 Mapper 接口
 * </p>
 *
 * @author hehehe
 * @since 2025-05-26
 */
@Mapper
public interface CourseSelectionMapper extends BaseMapper<CourseSelectionDO> {
    int countByCourseId(@Param("courseId") Long courseId);

    boolean existsByUserIdAndCourseId(@Param("userId") Long userId, @Param("courseId") Long courseId);

    int countSelectionsByUser(@Param("userId") Long userId);
}
